cmake_minimum_required(VERSION 3.4)

# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_C_COMPILER "/home/fang/clang/bin/clang")
# set(CMAKE_CXX_COMPILER "/home/fang/clang/bin/clang++")

# set the project name
project(FuzzDemo)

option(DATE_ENABLE "output date" ON)
if(DATE_ENABLE)
    set(DATE "2022.7.12")
endif()


configure_file(config.h.in config.h)

add_subdirectory(fuzzer)


# target_compile_definitions(-g -fsanitize=address)
add_compile_options(-fsanitize=fuzzer -g ) #注意这里，必须使用fuzzer，与libFuzzer形成连接

# link_libraries(Fuzzer)

# add the executable
add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC Fuzzer asan pthread)
# target_link_libraries(${PROJECT_NAME} pthread dl)

include_directories(${PROJECT_BINARY_DIR})

target_include_directories(${PROJECT_NAME} PUBLIC
                           ${PROJECT_BINARY_DIR}
                        #    ${PROJECT_SOURCE_DIR}/fuzzer
                           )

